package com.zwps.biz.controller.common;

import com.zwps.biz.domain.service.AuthService;
import com.zwps.common.api.CommonUserAPI;
import com.zwps.common.api.model.vo.LoginInfoVO;
import com.zwps.common.controller.CommonController;

import io.swagger.v3.oas.annotations.Hidden;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashSet;
import java.util.Set;

/**
 * 
 * @ClassName: CommonUserApiController
 * @Description:
 * @author lyh
 * @date 2023年5月20日 上午9:42:19
 *
 */
@Hidden
@RestController
@RequestMapping("common/user")
public class CommonUserApiController extends CommonController implements CommonUserAPI {

    @Autowired
    private AuthService authService;

    @GetMapping("role_codes")
    @Override
    public Set<String> getUserRoleCodes(String userId) {
        return new HashSet<String>();
//        return userService.getRoleByUserName(userId);
    }

    @GetMapping("permission_codes")
    @Override
    public Set<String> getUserPermissionCodes(String userId) {
        return new HashSet<String>();
    }

    @GetMapping("login_info")
    @Override
    public LoginInfoVO authAndReturnLoginInfo(String token) {
        return authService.authToken(token);
    }

}
